﻿
@{
    ViewData["Title"] = "修改密码";
}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" style="margin-right: 50px;">

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>原密码:
                    </label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input" name="oldpassword" lay-verify="required" required>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>新密码:
                    </label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input" name="newpassword" lay-verify="required" required>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <span class="x-red">*</span>确认密码:
                    </label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input" name="repassword" lay-verify="required" required>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <button class="layui-btn" lay-submit lay-filter="save">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>

@section scripts{
    <script>
        layui.form.on('submit(save)',
            function(data) {
                $.post("@Url.Action("doUpdatePwd")",
                    data.field,
                    function(ro) {
                        layer.msg(ro.msg,
                            { time: 500 },
                            function() {
                                if (ro.success) {
                                    closeXWindow(true);
                                }
                            });
                    });
                return false;
            });
    </script>
}